local haidan = fk.CreateSkill{
name = "st__haidan",
}
haidan:addEffect(fk.Damaged,{
can_trigger = function (self, event,target,player,data)
    return target == player and target:hasSkill(self.name)
    and data.card and player.room:getCardArea(data.card) == Card.Processing
end,
on_use = function(self, event, target, player, data)
    local room = player.room
    player.room:obtainCard(player, data.card, true, fk.ReasonJustMove, player, self.name)
    local choices = {"#st__haidan-use", "#st__haidan-no"}
    local choice = room:askToChoice(player, {
      choices = choices,
      skill_name = self.name,
    })
    if choice:startsWith("#st__haidan-use") then
    room:useCard({
                card = data.card,
                from = player,
                tos = {data.from},
                skillName = self.name
            })
    end
end,
})
Fk:loadTranslationTable
{
  ["st__haidan"]="海胆",
  [":st__haidan"]="当你受到伤害后，你可以获得对你造成伤害的牌，然后你可以对伤害来源使用此牌",
  ["#st__haidan-use"]="对伤害来源使用此牌",
  ["#st__haidan-no"]="否",
}

return haidan
